"IF Trainer" by Juhana Leinonen and Drew Taylor

Volume Setup

Book Compiler settings

[Use no deprecated features.	<-- All the extensions haven't been updated for the newest build that deprecates some of the commonly used features, so we can't use this option]

To decide whether debugging:
	decide yes. [REMEMBER TO SWITCH TO NO for releases!]

Use american dialect, the serial comma, no scoring.


Book Extensions

[Basic structure for displaying suggestions on what to do next.]
Include version 1 of Action Hints by Juhana Leinonen.

[Basic Screen Effects contains e.g. centering, text colors, pausing]
Include Basic Screen Effects by Emily Short.

[For manipulating the library messages]
Include version 2 of Default Messages by Ron Newcomb.

[Different punctuation stuff]
Include version 2 of Dialogue Punctuation by Ron Newcomb.

[Disambiguation Control replaces the built-in disambiguation mechanism with a more sophisticated one. The downside is that you can't use the Does the player mean... rules anymore, which is a potential pitfall if other extensions rely on them.]
Include version 6 of Disambiguation Control by Jon Ingold.

[Epistemology is for remembering whether the player has seen a thing or knows about it]
Include version 5 of Epistemology by Eric Eve.

[Advanced banner manipulating, which is useful since we'll replace the entire banner with a custom one]
Include version 5 of Extended Banner by Stephen Granade.

[Adds the ability to mark things as being out of reach]
Include version 4 of Far Away by Jon Ingold.

[Most notably adds the note style for properly formatting score notifications]
Include Glulx Text Effects by Emily Short.

[Testing objects' responses to actions]
Include version 4 of Object Response Tests by Juhana Leinonen.

[Pronoun and plurality handling]
Include version 8 of Plurality by Emily Short.

[Remembering changes the "you can't see that" message to "you last saw X in Y", which is more helpful than the default]
Include version 3 of Remembering by Aaron Reed.

[Automatic reversal of HELLO, BOB to the correct BOB, HELLO form]
Include version 2 of Reversed Persuasion Correction by Juhana Leinonen.

[Provides modifications to the parser that fix many of its annoyances and extends its capabilities]
Include version 3 of Small Kindnesses by Aaron Reed.

[Helpful responses for common invalid input]
Include version 5 of Smarter Parser by Aaron Reed.

[Message Queue allows queuing messages so that they don't all appear during the same turn. The trainer uses a modified version of the extension so that different voices can be used in the queues.]
Include version 1/100807 of Trainer Message Queues by Juhana Leinonen.

[Detecting whether the interpreter supports unicode so that substitutions can be used if this is not the case]
Include version 2 of Unicode Interrogation by Michael Martin.


Book Helpers

Chapter Additional screen effects

To display a pause:
	narrative;
	say paragraph break;
	say "          [bracket]press space to continue[close bracket]";
	say paragraph break;
	say line break;
	wait for the SPACE key.
	
To say interrobang:
	if unicode 8253 is supported:
		say "[unicode 8253]";
	otherwise:
		say "!?[run paragraph on]".


Chapter Definitions

Definition: a direction is viable if the room it from the location is a room.


Chapter Lists

To say the/-- list of (listing - a list of indexed text) separated by (separator - some text):
	if the number of entries in listing is 0:
		stop;
	if the number of entries in listing is 1:
		say entry 1 of listing;
		stop;
	repeat with N running from 1 to the number of entries in listing:
		if the number of entries in listing is N:
			if N is not 2:
				say ",";
			say " [separator] ";
		otherwise if N is not 1:
			say ", ";
		say entry N of listing.
		

Chapter Shortcuts

[run paragraph on shortcuts. Note that 'To say rpo: say run paragraph on.' doesn't work because it uses a say phrase. The pure I6 function has to be used to avoid extra line breaks.]
To say rpo -- running on:
	(- RunParagraphOn(); -).
	
To rpo:
	say rpo.
	

Book Publishing

Chapter Bibliographic data

The story headline is "An introduction to Interactive Fiction".
The story genre is "Science Fiction".
The release number is 0.
The story creation year is 2010.


Chapter Release options
 
Release along with the source text and the "Quixe" interpreter.


Book In-game meta info

Chapter Banner text

The extended banner rule is not listed in any rulebook.

Rule for printing the banner text (this is the REAPR says the extended banner rule):
	display "Project: ";
	say bold type;
	display "[story title]";
	say roman type;
	if presentation choice is font variation:
		say fixed letter spacing;
	display "[line break]Lead developers: [story author][line break]Release [release number] / Serial number [story serial number] / Inform 7 build [I7 version number][paragraph break]".
	

Volume Library messages

Book Custom library messages

[The table that includes the library messages is huge. As a result whenever you start writing a comment with a square bracket the IDE hangs for about 30 seconds. For the sake of everyone's health and sanity it's better to have the huge table in an external file.]
Include Trainer Library Messages by Juhana Leinonen.

To decide what text is Cap That's-They're of/-- (item - an object): mark item in output; if the item acts plural or the item is the player, decide on "They're"; otherwise decide on "That's".
To decide what text is Cap It-Those of/-- (item - an object): mark item in output; if the item acts plural or the item is the player, decide on "Those"; otherwise decide on "It".
To say #if American dialect: (- #ifdef DIALECT_US; -) .
To say #if Z-machine: (- #ifdef TARGET_ZCODE; -) .
To say #otherwise: (- #ifnot; -) .
To say #end if: (- #endif; -) .

To decide which snippet is the quoted verb: (- ((verb_wordnum * 100) + 1) -) .
To decide which text is (quoted word - a snippet) posture:
     if the quoted word matches "stand", decide on "stand on";
     if the quoted word matches "sit", decide on "sit down on";
     if the quoted word matches "lie", decide on "lie down on";
     otherwise decide on "enter".


Chapter Far away

[changing the "out of reach" message to be said by REAPR]
The last distant objects rule when reporting errors (this is the REAPR can't touch rule):
	display far-off-message;
	rule fails.
	
The can't touch rule is not listed in the distant objects rules.


Chapter Remembering

Rule for printing a parser error when the latest parser error is the noun did not make sense in that context error (this is the REAPR can't see that rule):
	display "I can't see any such thing here.".
	[TODO add Evie explaining this]
	
The replace did not make sense in that context rule is not listed in any rulebook.
	

Chapter Room description details

[this is copied from the standard library, but all say phrases are replaced with displays and paragraph breaks are fixed]
For printing the locale description (this is the new you-can-also-see rule):
	let the domain be the parameter-object;
	let the mentionable count be 0;
	repeat with item running through things:
		now the item is not marked for listing;
	repeat through the Table of Locale Priorities:
		[say "[notable-object entry] - [locale description priority entry].";]
		if the locale description priority entry is greater than 0,
			now the notable-object entry is marked for listing;
		increase the mentionable count by 1;
	if the mentionable count is greater than 0:
		repeat with item running through things:
			if the item is mentioned:
				now the item is not marked for listing;
		begin the listing nondescript items activity with the domain;
		if the number of marked for listing things is 0:
			abandon the listing nondescript items activity with the domain;
		otherwise:
			if handling the listing nondescript items activity:
				say paragraph break; [added this line]
				if the domain is a room:
					if the domain is the location, display "I";
					otherwise display "In [the domain] I";
				otherwise if the domain is a supporter:
					display "On [the domain] I";
				otherwise if the domain is an animal:
					display "On [the domain] I";
				otherwise:
					display "In [the domain] I";
				display "can [if the locale paragraph count is greater than 0]also [end if]see ";
				let the common holder be nothing;
				let contents form of list be true;
				repeat with list item running through marked for listing things:
					if the holder of the list item is not the common holder:
						if the common holder is nothing,
							now the common holder is the holder of the list item;
						otherwise now contents form of list is false;
					if the list item is mentioned, now the list item is not marked for listing;
				filter list recursion to unmentioned things;
				if contents form of list is true and the common holder is not nothing,
					list the contents of the common holder, as a sentence, including contents,
						giving brief inventory information, tersely, not listing
						concealed items, listing marked items only;
				otherwise display "[a list of marked for listing things including contents]";
				if the domain is the location:
					display "here.";
				otherwise:
					display "."; [<-- removed paragraph break from here]
				unfilter list recursion;
			end the listing nondescript items activity with the domain;
	continue the activity.
	
The new you-can-also-see rule is listed instead of the you-can-also-see rule in the for printing the locale description rules.
	

Chapter Small Kindnesses

[the retreating action is defined in the Small Kindnesses extension. We have to change the failure message to something said by REAPR. The only place where the player can see this message is the hangar before moving to another room.]
Check retreating when the heart of the volcano is unvisited:
	display "[if robotic]Unknown destination.[otherwise]I can't go back - I haven't even moved yet!";
	stop the action.

[The following rules are handled in the main code]
The small kindnesses automatically get out of containers before going rule is not listed in any rulebook.
The small kindnesses don't get out of containers automatically when nowhere to go rule is not listed in any rulebook.
The small kindnesses reporting on exits rule is not listed in any rulebook.


Chapter Miscellaneous

[there has to be something after VERSION, otherwise there's an extra paragraph break at the end apparently because extension listing is printed at I6 level which skips the checks the Dialogue Punctuation extension makes.]
Report requesting the story file version:
	display "Please type ABOUT for more information."
	


Volume Voices

Part Settings 

When play begins:
     now the sentence break is " ".


Section - internal (in place of Section - internal in Default Messages by Ron Newcomb) unindexed

To #if library message alerts is active and not in a release build: (- #ifdef DEBUG; #ifdef LIBRARY_MESSAGE_ALERTS; -). 
To #end if library message alerts is active and not in a release build: (- #endif; #endif; -). 

[due to a bug in I7 you can't use to-phrases that start with "end" in a python-style block. "end dialogue" is used in Dialogue Punctuation.]
To finish dialogue:
	end dialogue. 

To decide if intervened in miscellaneous message: 
	[library message 10 which is the response to empty input ("I beg your pardon?") is a special case; it's extremely hard to manage and it tends to print line breaks where it shouldn't. We have to fake the ]
	if the library message number is 10:
		if the presentation choice is narrator's name:
			say "REAPR: '";
		otherwise:
			say fixed letter spacing;
		say "[if robotic]No input[otherwise]I don't know what to do[end if].[rpo]";
		if the presentation choice is narrator's name:
			say "'[rpo][line break][line break]";
		otherwise:
			say variable letter spacing;
			rpo;
		show action hints;
		assist "[one of]. If you don't want to do anything special, you can command WAIT or use its abbreviation Z[rpo][or][stopping]";
		finish dialogue;
	otherwise:
		say REAPR speaking;
		repeat through the table of custom library messages:
			if the library-message-id entry is the library message number and there is no library-action entry:
				say the library-message-text entry;
				say run paragraph on; [added because of the Dialogue Punctuation extension]
				[unless library message number is -1, say line break;   <-- displays too many line breaks]
				decide yes;
	#if library message alerts is active and not in a release build;
	say "{ library message #[library message number] }[paragraph break]";
	#end if library message alerts is active and not in a release build;
	decide no.

To decide if intervened in miscellaneous list message: 
	say REAPR speaking;
	increase library message number by 100;
	repeat through the table of custom library messages:
		if the library-message-id entry is the library message number and there is no library-action entry:
			say the library-message-text entry;
			say run paragraph on; 
			decide yes;
	#if library message alerts is active and not in a release build;
	say "{ library message #[library message number] }[paragraph break]";
	#end if library message alerts is active and not in a release build;
	decrease library message number by 100;
	decide no.

To decide if intervened in action message: 
	say REAPR speaking;
	repeat through the table of custom library messages:
		if the library-message-id entry is the library message number  and there is a library-action entry and the library-action entry is the library message action:
			say the library-message-text entry;
			say run paragraph on;
			[unless library message number is -1, say line break;]
			decide yes;
	#if library message alerts is active and not in a release build;
	say "{ [library message action] action #[library message number] }[paragraph break]";
	#end if library message alerts is active and not in a release build;
	decide no.




Part Choosing narration presentation

Presentation type is a kind of value. Presentation types are font variation and narrator's name.

Presentation choice is a presentation type that varies. Presentation choice is narrator's name.

Choosing the narration presentation is an action out of world.
Understand "style" as choosing the narration presentation.

Carry out choosing the narration presentation:
	if the presentation choice is font variation:
		now presentation choice is narrator's name;
	otherwise:
		now presentation choice is font variation.
		
Report choosing the narration presentation:
	display "Presentation style changed."


Part Different actors

Evie says not mentioned is truth state that varies. Evie says not mentioned is false.

To say brief assistance ending:
	now Evie says not mentioned is true.

To say open quote (n - number):
	if the currently speaking character is:
		-- Malyon von Gloom:
			do nothing;
		-- Evie:
			if the presentation choice is font variation:
				say italic type;
			otherwise:
				say "'";
		-- REAPR:
			say fixed letter spacing;
			if the presentation choice is narrator's name:
				say "[bracket]";
	now outside-quotes is false.

To say close quote (n - number):
	if the presentation choice is font variation:
		say roman type;
		if the currently speaking character is Evie and Evie says not mentioned is false:
			say ".[rpo]";
	otherwise:
		if the currently speaking character is:
			-- Evie:
				if Evie says not mentioned is false:
					say ",' [Evie] says.[rpo]";
				otherwise:
					say "'[rpo]";
			-- REAPR:
				say "[close bracket][rpo]";
	say variable letter spacing;
	now outside-quotes is true;
	now Evie says not mentioned is false. 
	
[there's a bug (?) in the extension which makes the opening quote print as if it were the previous speaker; the following fixes that.]

To say (character - a person) speaking:
	now the dialogue punctuation extension is true;
	if character is not the currently speaking character begin;
		if inside quotes, say "[run paragraph on][close quote 6]";
		say "[if the currently speaking character is not nothing][speaker break][end if][indentation]"; [<-- this used to have [open quote 1] at the end]
		now the currently speaking character is the character;
		say open quote 1; [<-- this was added]
		now oldline is true;
	otherwise if outside quotes;
		say "[open quote 2][run paragraph on]";
		now oldline is true;
	otherwise if oldline is true;
		say sentence break;
	end if.
	


[say phrases have been replaced with three different phrases: narrate, assist and display. Narrate is the "normal" case with the narrator and von Gloom. Assist is the assistant (tutorial voice) and display is REAPR speaking.]
To narrate (txt - text):
	say Malyon von Gloom speaking;
	say txt;
	say run paragraph on.
	
To assist (txt - text):
	say Evie speaking;
	say txt;
	say run paragraph on.
	
To display (txt - indexed text):
	say REAPR speaking;
	say fixed letter spacing; [required for looking action and for others where the style changes between saying things]
	say txt;
	say run paragraph on.
	
To start a/-- new paragraph for (voice - a person):
	if the currently speaking character is voice:
		narrative;
		say paragraph break.


Volume Advice


Book Advisory rulebook

Advisory rules is a rulebook.

This is the advisory rulebook following rule:
	follow the advisory rules.

The handle the main message queue rule is listed last in the every turn rulebook.
The advisory rulebook following rule is listed before the handle the main message queue rule in the every turn rulebook.	


Part Given advice

Table of given advice
advice name	used
"finding the arms installer"	false
"looking after going"	false
"no jetpack"	false
"turning tutorial off"	false

To mark advice/communication (name - text) used:
	choose the row with advice name of name from the table of given advice;
	now the used entry is true.
	
To decide whether the/-- advice/communication (name - text) is used:
	choose the row with advice name of name from the table of given advice;
	decide on the used entry.

To decide whether the/-- advice/communication (name - text) is not used:
	if advice name is used:
		decide no;
	decide yes.



Book Available actions

The displaying action hints activity has a number called displayed hints.

The max action hints is a number that varies. Max action hints is 3.

Before displaying action hints:
	if displayed hints > max action hints:
		rule fails; 
	increase displayed hints by 1;
	add "EXAMINE something" to the chosen hints.
	
Before displaying action hints:
	if displayed hints > max action hints:
		rule fails;
	increase displayed hints by 1;
	add "LOOK" to the chosen hints.
	
Before displaying action hints when the location is the heart of the volcano and the door-lever is unused and REAPR is armed:
	if displayed hints > max action hints:
		rule fails;
	increase displayed hints by 1;
	add "PULL LEVER" to the chosen hints.
	
Before displaying action hints when the location is the heart of the volcano and we have not read the poster:
	if displayed hints > max action hints:
		rule fails;
	increase displayed hints by 1;
	add "READ POSTER" to the chosen hints.
	
Before displaying action hints when REAPR is mobile:
	if displayed hints > max action hints:
		rule fails; 
	increase displayed hints by 1;
	add "GO [printed name of a random viable direction in upper case]" to the chosen hints.


Action hinting is an action applying to nothing.

Understand "action hint/hints" as action hinting.

Carry out action hinting (this is the assist with actions rule):
	assist "You could for example [current action hints]";
	rpo.
	
To show action hints:
	follow the assist with actions rule.


Book Examining
 
Chapter Deeper descriptions

A thing can be deeply described. A thing is usually not deeply described.

After examining a deeply described thing for the first time:
	let interesting detail be a random thing that is part of the noun;
	let an-interesting detail be indexed text;
	let an-interesting detail be "[an interesting detail]";
	let the-interesting detail be indexed text;
	let the-interesting detail be "[the interesting detail]";
	add "Did you notice that when you examined [the noun] REAPR mentioned [an-interesting detail]? Descriptions of objects often reveal more details you can further examine, although this is not always possible. You could, for example, EXAMINE [the-interesting detail in upper case]" to the main message queue spoken by Evie;
	continue the action.


Chapter Examining reminders

A thing can be perceived or unexamined. A thing is usually unexamined.

The last examine is a number that varies. The last examine is 0.
The examine tip count is a number that varies. The examine tip count is 0.

Carry out examining (this is the make examined things perceived rule):
	now the noun is perceived;
	now the last examine is the turn count.
	
An advisory rule when the last examine is greater than 0 and the turn count minus the last examine is greater than (examine tip count plus 1) times 10 and the number of perceived things is less than 15:
	let example1 be a random unexamined thing in the location;
	let example2 be a random unexamined thing in the location;
	if example1 is a thing and example2 is a thing and example1 is not example2:
		add "Remember that you should EXAMINE things you see around you. Here you could examine, for example, [the example1] or [the example2]" to the main message queue as negligible priority spoken by Evie; [made a negligible rule to avoid that if the player moves before the message is displayed, it will suggest objects out of scope.]
		now the last examine is the turn count;
		increase the examine tip count by 1.


Chapter Reading

After examining a readable thing for the first time:
	if the tutorial is on and we have not read the noun:
		let the suggestion be indexed text;
		let the suggestion be "[the noun]";
		add "If an object has text on it, you may get more information if you READ it, for example READ [the suggestion in upper case]" to the main message queue as low priority spoken by Evie;



Book Going

Chapter Available exits
	
To say available exits with (speaker - some text) speaking:
	["adjacent rooms" doesn't count exits that lead through a door, so the doors have to be calculated separately]
	if the number of rooms adjacent to the location + number of doors in the location is 1:
		repeat with X running through directions:
			if the room X from the location is a room: 
				say "The only exit is [X][if room X from the location is visited] to [the room X from the location][end if].[rpo]";
				stop;
	say "Available exits are ";
	let unknown exit listing be a list of indexed text;
	let known exit listing be a list of indexed text;
	repeat with X running through directions:
		if the room X from the location is a room and the room X from the location is unvisited:
			add "[X]" to unknown exit listing;	
	repeat with X running through directions:
		if the room X from the location is a room and the room X from the location is visited:
			add "[X] to [the room X from the location]" to the known exit listing;
	if the unknown exit listing is not empty:
		say the list of the unknown exit listing separated by "and";
		if the known exit listing is not empty:
			say ", or [speaker] could go back ";
	if the known exit listing is not empty:
		say the list of the known exit listing separated by "or";
	say ".[rpo]".

Instead of going nowhere:
	display "I can't go that way.[rpo]";
	try listing exits.

Book Irrelevant things

Chapter Mentioning irrelevant things

A thing can be irrelevant. A thing is usually not irrelevant.

Before doing something other than examining when noun is irrelevant or the second noun is irrelevant:
	if a random chance of 1 in 4 succeeds:
		if the noun is irrelevant:
			add "I'm sure [the noun] is not important for us." to the main message queue with negligible priority spoken by Evie;
		otherwise:
			add "I'm sure [the second noun] is not important for us." to the main message queue with negligible priority spoken by Evie;			
	continue the action.



Book Smarter Parser

Before printing a parser error (this is the Smarter Parser trying not so hard to understand rule):
	now the original rejected command is the player's command;
	now the rejected command is the player's command; 
	follow the Smarter Parser rules;
	if the rule succeeded or the rule failed:
		now suppress parser error is true.
		
The Smarter Parser trying not so hard to understand rule is listed instead of the Smarter Parser trying harder to understand rule in the before printing a parser error rulebook.

[overwritten to use Evie's voice, and making sure not having a custom response is a bug.]
To print explanation for (why - a rule):
	if sp-debug is true, say "(smart parser debug: printing message for [why])[command clarification break]";
	if there is a therule of why in Table of Extended Smarter Parser Messages:
		choose row with a therule of why in Table of Extended Smarter Parser Messages;
		assist message entry;
	otherwise if there is a therule of why in Table of Smarter Parser Messages:
		display "PROGRAMMING ERROR: Smarter Parser message for [why] not overwritten."


Book Turning tutorial off

Player might be expert is a truth state that varies. Player might be expert is false.

Every turn when player might be expert is true and advice "turning tutorial off" is not used:
	add "If you are already familiar with the system you can command TUTORIAL OFF if you wish to continue without assistance" to the main message queue as low priority spoken by Evie;
	mark advice "turning tutorial off" used.
	
Carry out taking inventory when the introduction is happening (this is the taking inventory before it's mentioned means player might be an expert rule):
	now player might be expert is true.


Volume Actions

Book Out of world

Chapter Listing exits

Listing exits is an action applying to nothing.

Understand "exits" as listing exits.

Carry out listing exits:
	say REAPR speaking;
	say available exits with "I" speaking;
	rpo;
	narrative.
	

Chapter Toggling tutorial mode

On-off state is a kind of value. On-off states are off and on.

Tutorial is an on-off state that varies. Tutorial is on.

Toggling tutorial mode is an action out of world applying to a topic.

Understand "tutorial [text]" as toggling tutorial mode.

After reading a command:
	if the player's command matches "tutorial":
		replace the player's command with "tutorial status".

Check toggling tutorial mode:
	if the topic understood does not match "on/off/status": 
		display "I did not understand the words after TUTORIAL." instead.

Check toggling tutorial mode "status":
	if tutorial is off:
		assist "The tutorial mode has been turned off. If you wish to resume the tutorial mode, you have to restart the mission.[brief assistance ending]";
	otherwise:
		try toggling tutorial mode "on" instead.

Check toggling tutorial mode "on":
	if tutorial is off:
		assist "I'm sorry, but you cannot turn tutorial mode back on without restarting the mission.[brief assistance ending]";
	otherwise:
		assist "Tutorial mode is already on.[brief assistance ending]";
	stop the action.

Check toggling tutorial mode "off" when the tutorial is off:
	assist "Tutorial mode has already been turned off.[brief assistance ending]" instead.

Carry out toggling tutorial mode "off":
	now tutorial is off.
	
Report toggling tutorial mode "off":
	assist "All right, I'll ease on the advices. Please note that you cannot resume tutorial mode later without restarting the mission, so please UNDO now if you want to continue with the tutorial"
	


Book Library actions

Chapter Eating

[Small Kindnesses has the right idea for not requiring an implicit take when eating, but the method it uses doesn't allow for custom messages for trying to eat individual objects]
The small kindnesses don't implicity take inedibles rule is not listed in any rulebook.

[procedural rules are deprecated, but this is the only method I found that works.]
Procedural rule while eating: ignore the carrying requirements rule.


Chapter Entering

Understand "step on [supporter]" as entering.


Chapter Examining

This is the new standard examining rule:
	if the noun provides the property description and the description of the noun is not "":
		display "[the description of the noun]";
		now examine text printed is true.	

The new standard examining rule is listed instead of the standard examining rule in the carry out examining rulebook.


Chapter Jumping

[We'll make jumping an action that succeeds by default.]

The block jumping rule is not listed in any rulebook.

First report jumping:
	narrate "You feel the robot bend its knees, jump in the air and come down again. It takes a while for the chassis to stop trembling.";
	
Report jumping when the location is not the heart of the volcano for the first time:
	start a new paragraph for von Gloom;
	narrate "'Oh my poor floors,' you sigh."


Book New actions

Chapter Reading

Reading is an action with past participle read applying to one visible thing.

Understand the command "read" as something new.
Understand "read [something]" as reading.

A thing has some text called writing. The writing of a thing is usually "".

Definition: A thing is readable rather than unreadable if it provides the property writing and the writing of it is not "".

Should the game suggest reading something readable: it is a good suggestion.

Check reading when the writing of the noun is "":
	display "There's nothing written on [the noun]." instead.
	
Check reading when the noun does not provide the property writing: ["read south" and similar]
	display "That's not something you could read!" instead.
	
Carry out reading:
	display the writing of the noun.
	

Chapter Using (in place of Chapter - Implement Use verb for common actions in Small Kindnesses by Aaron Reed)

[The rules in the extensions are mainly all right, but we have to change the definition of the action to applying to one VISIBLE thing for the mobility rules.]

Understand "use [an edible thing]" as eating. 
Understand "use [a wearable thing]" as wearing. 
Understand "use [a closed openable container]" as opening. Understand "use [an open openable container]" as closing. 
Understand "use [something preferably held] on [a locked lockable thing]" as unlocking it with (with nouns reversed). Understand "use [something preferably held] on [an unlocked lockable thing]" as locking it with (with nouns reversed). 
Understand "use [a switched off device]" as switching on. 
Understand "use [a door]" as opening. Understand "use [an open door]" as entering. 

Using is an action applying to one visible thing. Understand "use [something]" as using. 

Check using: 
	if robotic:
		display "Ambiguous command. Unable to comply.";
	otherwise:
		display "I'm confused[if the noun is the player]. What should I do?[otherwise]. How should I use [the noun]?[end if]";
	assist "The command USE is generally too vague for REAPR to understand. Try to come up with a more specific command that better describes what you want to do";
	stop the action.




Volume World

Book Intro

When play begins (this is the show intro rule):
	narrate "You climb inside the robot and find yourself in a cramped and dark space. You sit down and see two screens in front of you. The right screen is dark but the left one flickers to life. [Evie], your assistant, appears on it.[rpo]";
	assist "Good morning [sir]. How are you today?[brief assistance ending]";
	narrate "'Never better!' you exclaim. 'Haven't you heard the news? (Hero 1) is on a mission in South Africa, Captain McBrawn is off combating Screaming Communists and (hero 3) and (hero 4) are down with the flu. (Hero 5) is still recovering from his last conflict with (some villain). (Hero 6) retired last week. There's no-one left to defend Hyperiome City!";
	assist "Sounds like you can finally carry out your plan to conquer the city.[brief assistance ending]";
	narrate "'Exactly! I just need to get this damn robot to start...'";
	assist "I can initiate the startup sequence from here, although I must warn you that...[brief assistance ending]";
	narrate "'Great. Just do it.'";
	display a pause;
	narrate "Rows of text appear on the right screen.";
	display "Initializing startup sequence........DONE";
	say line break;
	display "Starting AI core.....................DONE";
	say line break;
	display "Loading language module..............DONE";
	say line break;
	display "Loading knowledge database...........DONE";
	say line break;
	display "Loading personality module...........FAILED";
	say line break;
	display "Personality module initialization failed. Retry scheduled.";
	say line break;
	display "Loading extensions...................DONE";
	say line break;
	display "Loading graphical interface..........FAILED";
	say line break;
	display "Graphical interface not found. Using terminal.";
	say line break;
	display "Loading INFORM-7 terminal............DONE";
	say line break.

Instead of looking for the first time:
	display "Core startup sequence completed. Further startup procedures scheduled.

REAPR-S1 ready for input.";
	display a pause;
	narrate "'Um, what?'";
	assist "[Sir], I'm afraid the REAPR-S1 combat robot is still under development and missing some key features. You might have noticed that the cockpit is... somewhat bare. We haven't fitted it with the actual controls yet. The terminal is the only way to operate it at the moment.[brief assistance ending]";
	narrate "'And I'm supposed to take over the world with this[interrobang] Forget it, I'll take the Doom Tank.'";
	assist "The tank was wrecked during your last confrontation with the Human Sledgehammer.[brief assistance ending]";
	narrate "'Right. How about the Mayhem Shuttle?'";
	assist "Taken apart for maintenance.[brief assistance ending]";
	narrate "You hold back a stream of bad words. 'Right. Ok. Right. We'll just have to make do with what we have. How do I control this thing?'";
	assist "There is a keyboard in front of you. Type in what you want REAPR to do and press enter. On the screen it will describe what happens.[brief assistance ending]";
	narrate "'All right. What do I type?'";
	assist "REAPR is still in the middle of initializing its systems. We can't start moving before the engines have started but now you could have it describe the environment by typing LOOK.[brief assistance ending]".


Book Characters

Part Main characters

[The main characters are "part of REAPR" so that they are automatically in scope all the time.]

Chapter Malyon von Gloom

Malyon von Gloom is a woman. Malyon von Gloom is part of REAPR.

To say sir:
	if Malyon von Gloom is woman:
		say "ma'am";
	otherwise:
		say "sir".
		
To say Sir:
	if Malyon von Gloom is woman:
		say "Ma'am";
	otherwise:
		say "Sir".

To say von Gloom's gender:
	if Malyon von Gloom is woman:
		say "woman";
	otherwise:
		say "man".
		
To say daddy:
	if Malyon von Gloom is woman:
		say "mommy";
	otherwise:
		say "daddy".


Chapter Evie

Evie is a woman. Evie is part of REAPR. The printed name of Evie is "[if female]Evie[otherwise]Eddie[end if]".


Chapter REAPR-S1

REAPR is a person. REAPR can be robotic or personified. REAPR is robotic.

To decide whether robotic:
	decide on whether or not REAPR is robotic.
	
The player is REAPR.


Book Geography

Part Settings

Chapter Map setup

The hangar is a room. The hangar-door is a door. The hangar-door is south of the hangar. The heart of the volcano is south of the hangar-door. The workshop is west of heart of the volcano. The volcano-door is a door. The volcano-door is south of the heart of the volcano and north of the corridor. The launch central is east of the corridor. The engine room is southwest of the corridor.


Chapter Looking

Rule for printing the name of a room (called the place) while looking:
	display "[if robotic]Location name: [end if]";
	say bold type;
	say "The [printed name of place]";
	say roman type.

[overrides a library function that prints the room description. All it basically does is not use the I6 function and adds the run paragraph on so that REAPR end quotes show ok.]
To print the location's description:
	display "[description of the location][rpo]";


Book Rooms

Part Hangar

The description of the hangar is "[hangar-desc][rpo]".

To say hangar-desc:
	if robotic:
		say "General description: The purpose of the current room is storage and deployment of combat vehicles.
[line break]Items of interest: Control center. Crane. Crane controls. Hangar doors.
[line break]Room size: 498.6 square meters (approximate).
[line break]Exits: South.";
	otherwise:
		say "Wow, look at this place! It's so big and empty! There's a lifting thing high up in the ceiling and there's a spiraly stairy thing spiraling up. It goes to a control room up behind glass windows on the southern wall. There's a control panel set to the north wall.

There's a door to the south. It's [if the hangar-door is closed]closed[otherwise]open[end if].[rpo]"

Hangar is visited. [fixes a bug that makes the starting room unvisited]


Chapter Hangar door

The printed name of the hangar-door is "hangar door". The hangar-door is scenery.
Understand "hangar door" and "door" as the hangar-door.

Check closing an open hangar-door:
	display "There's no obvious way to close the door.";
	assist "You don't need to worry about the door anymore, [sir]"
	
Carry out opening a closed hangar-door when not going:
	display "I see no way to open the door.";
	assist "I'll have to open the door remotely from here. Just a moment, [sir]";
	
Report opening the hangar-door:
	display "No wait! It's opening now!";
	stop the action.

First before going south when the hangar-door is closed and REAPR is mobile:
	display "There's a big door in the way.";
	assist "Just a moment. I can open the hangar door from here";
	display "No wait! It's opening now! I'm going through...";
	now the hangar-door is open.
	
Before going south from the hangar when the hangar-door is open and the heart of the volcano is unvisited:
	narrate "You feel the swaying motion and hear the pneumatic cylinders in the robotic legs hiss when the robot walks onwards.[rpo]".


Chapter Control center

The control center is scenery in the hangar. The control center is deeply described and distant. The description of the control center is "[if robotic]The control center is behind glass panels on the western wall. It contains: computer terminals, chairs, blackboards, miscellaneous. A spiral staircase leads up to a door which leads to the control center.[otherwise]There's a control center behind glass panels on the southern wall. It seems like there's computer terminals, chairs, blackboards and similar stuff there. A spiral staircase [end if][if the spiral staircase is wrecked and REAPR is not robotic]lies in a twisted heap under the control center[otherwise if not robotic]leads up to the control center[end if]."

The control center can be wrecked or intact. The control center is intact.

Before searching the control center: [takes care of LOOK IN CONTROL CENTER]
	try examining the control center.


Section Spiral Staircase

The spiral staircase is a part of the control center. The spiral staircase is irrelevant. The spiral staircase can be wrecked or intact. The spiral staircase is intact. The description is "[if robotic]A spiral staircase. Composition: metal alloy. Leads from the ground up to the control center.[otherwise if intact]The spiral staircase leads up to the control center's entrance.[otherwise]The staircase is nothing more than a twisted heap of metal anymore."

Instead of climbing the spiral staircase:
	narrate "The staircase is too small for me to climb!".
	

Section Control center miscellaneous

The cc stuff is scenery in the hangar. It is distant, irrelevant, plural-named and privately-named. The printed name of cc stuff is "things inside the control center". 

Understand "stuff/thing/things" and "misc/miscellaneous/various" and "computer" and "terminal/terminals" and "chair/chairs" and "blackboard/blackboards" and "inside" and "inside control center" and "inside the control center" and "inside center" and "inside the center" as cc stuff.

The description of cc stuff is "[if robotic]The control center contains: computer terminals, chairs, blackboards, miscellaneous.[otherwise]Seems like there's computer terminals, chairs, blackboards and similar stuff in the control center."


Chapter Crane

The crane is scenery in the hangar. The crane is distant. The description is "[if robotic]A mechanism to lift and move heavy objects. It is attached to railings in the ceiling to allow for increased mobility.[paragraph break]Height: 13.4 meters.[line break]Max. load: 5.5 metric tons.[line break]Max. movement speed: 7 km/h.[line break]Position: [end if][if robotic and the crane is retracted]by the eastern wall.[otherwise if robotic]by the western wall.[end if][if not robotic]A big crane is "

The crane can be retracted or extended. The crane is retracted. 

Instead of using the crane:
	try using the crane controls.


Section Claw

The crane claw is part of the crane. The description is "The crane has a claw that can be opened or closed."

The crane claw can be open or closed. Understand "crane's" as the crane claw.

Before opening or closing or using the crane claw:
	display "(by pushing the button on the control panel)[command clarification break]";
	try pushing the crane button instead.
	

Section Crane controls

The crane controls are scenery in the hangar. The description is "[if robotic]Crane controls with a lever and a button.[otherwise]The control panel seems to control the crane. There's a lever I can push or pull, and a button I can push."

The crane controls are plural-named and privately-named.

Understand "control" and "crane control/controls" and "panel" and "lever" as the crane controls.


The crane lever is part of the crane controls. The description is "The lever can be pushed or pulled. It controls the crane's position."

The crane button is part of the crane controls. The description is "The button controls the crane's claw, opening and closing it."

Definition: the crane lever is pushed rather than pulled if the crane is retracted.

Instead of using or pushing or pulling the crane controls:
	display "There's a lever and a button. I can either push or pull the lever, or push the button.".
	

Instead of pushing the crane lever when the crane lever is pushed:
	display "The lever doesn't move any further." 

Instead of pulling the crane lever when the crane lever is pulled:
	display "The lever doesn't move any further."
	
Instead of pushing the crane lever:
	display "The crane slides back next to the eastern wall.";
	now the crane is retracted.
	
Instead of pulling the crane lever:
	if the control center is intact:
		display "The crane's arm races towards the western wall and the control center...";
		narrate "You hear bang and a sound of shattering glass.";
		display "Whoopsie.";
		if tutorial is on:
			assist "In some situations you might want to UNDO your last move, but during this mission it should not be necessary. The control center is not important to us";
		now the control center is wrecked;
	otherwise:
		display "The crane's arm moves again towards the western wall. Its claw drops inside the control center.";
	now the crane is extended.

Instead of pushing the crane button:
	if the crane claw is open:
		now the crane claw is closed;
	otherwise:
		now the crane claw is open;
	display "I push the button and the crane's claw [if the crane claw is open]opens[otherwise]closes[end if].".
	


Part Heart of the Volcano

The description of the heart of the volcano is "This is such a wonderful place! There's [a launchpad] painted on the floor and another control center on the west wall. And there's no roof at all, just stone walls going all the way up to the sky.

On the wall there's a big poster with a picture of a stern looking [von Gloom's gender] on it.

A door north leads back to the hangar and there's another door to the south with a lever next to it. A hallway opens to west."

An advisory rule when going south and the location is the heart of the volcano and the advice "looking after going" is not used:
	add "As you can see, REAPR describes the new room every time it moves. You can see the room description again if you command LOOK" to the main message queue as high priority spoken by Evie;
	mark advice "looking after going" used.

To ponder flying through the crater:
	if the advice "no jetpack" is not used:
		add the there's no jetpack rule to the main message queue;
		mark advice "no jetpack" used.

This is the there's no jetpack rule:
	start a new paragraph for von Gloom;
	narrate "'How do I make this to fly up through the crater?' you ask.";
	assist "Ah yes. That is one of the things that's still missing from REAPR-S1. The jetpack is still going through design iterations, so the robot can't fly";
	narrate "'How will I get to the City then?'";
	assist "[brief assistance ending]You'll have to walk through the complex, I'm afraid."

Test volcano with "test mobility/s".


Chapter Launchpad

The launchpad is an enterable supporter in the heart of the volcano. The description is "[one of]There's a big red circle on the floor in the middle of the room, and a smaller red circle inside it. I'll look it up from the database... Oh, it's a launchpad.[or]The launchpad is a big red circle on the floor in the middle of the room. I think it's there for helicopters to land on.[stopping]". The launchpad is scenery. The printed name of the launchpad is "big circle".

Understand "launch" and "pad" and "big" and "circle" and "red" and "middle/centre/center" as the launchpad.

After examining the launchpad for the first time:
	now the printed name of the launchpad is "launchpad";
	ponder flying through the crater;
	continue the action.

Last report jumping in the heart of the volcano when the advice "no jetpack" is not used:
	ponder flying through the crater.
		

Chapter Poster

The get back to work poster is in the heart of the volcano. It is scenery. The description is "It's a picture of a mean looking [von Gloom's gender], filling almost the entire wall. There's some text written under [it-them of von Gloom]." The printed name of the get back to work poster is "poster";
The writing of the get back to work poster is "The text under the stern looking [von Gloom's gender] is 'Malyon von Gloom says: GET BACK TO WORK!'";

Understand "motivational" and "picture" and "text" and "malyon" and "von" and "gloom" as the get back to work poster.
Understand "man" as the get back to work poster when Malyon von Gloom is male.
Understand "woman/lady" as the get back to work poster when Malyon von Gloom is female.

After reading the get back to work poster for the first time:
	now the printed name of the get back to work poster is "[if the location is not the heart of the volcano]get back to work [end if]poster";
	narrate "You shrug. 'Of course I look stern. It's a motivational poster.'";
	continue the action.
	
Instead of taking the get back to work poster:
	display "I don't think I can get it off the wall."
	

Chapter Door to the corridor

The printed name of the volcano-door is "[if the location is the heart of the volcano]southern[otherwise]northern[end if] door". The volcano-door is scenery.

Understand "door" as the volcano-door.
Understand "south" and "southern" as the volcano-door when the location is the heart of the volcano.
Understand "north" and "northern" as the volcano-door when the location is the corridor.

Last after doing something with the volcano-door when we have not examined the door-lever:
	say paragraph break;
	try examining the door-lever;
	continue the action.
	
Check closing an open volcano-door:
	display "The lever might be the only way to close the door, and I think I broke it." instead.
	
Check of opening a closed volcano-door:
	display "There's no handle on the door.";
	assist "The lever next to the door opens it. You could try to PULL THE LEVER";
	stop the action.
	

Section Lever

The door-lever is in the heart of the volcano. The description is "There's a lever next to the door." The printed name of the door-lever is "lever". The door-lever is scenery.

Understand "lever" as the door-lever.

Definition: the door-lever is unused rather than broken if the volcano-door is closed.

Expecting lever pulling consent is a scene. Expecting lever pulling consent begins when we have examined the door-lever. Expecting lever pulling consent ends when the time since Expecting lever pulling consent began is 2 minutes.

Instead of saying yes while expecting lever pulling consent is happening:
	try pulling the door-lever.
	
Instead of saying no while expecting lever pulling consent is happening:
	display "Ok, I won't."

After examining the door-lever for the first time:
	display "Hey, should I pull it?"

Instead of pulling the unused door-lever:
	narrate "You hear metal bend and snap, then a rumbling sound.";
	display "Whoopsie, I pulled the lever too hard. I think I broke it. But the door rises up into the wall and reveals a corridor behind it.";
	assist "Looks like REAPR isn't quite aware of its own strength. No matter, we shouldn't need to close the door again. The way SOUTH is now open";
	now the volcano-door is open.
	

Part Workshop

The description of the workshop is "This room has all sorts of tools and machines, broken or half finished[one of]. A black iron thing...

Accessing database.....done.

...a[or]. A[stopping] black assault tank lies on the ground, completely broken. The hallway leads back east.

I see also a platform by a big machine with wires, copper wire coils and large gears."

Before going to the workshop:
	narrate "REAPR treads west through the hallway."

An advisory rule when the location is the workshop and the advice "finding the arms installer" is not used:
	add "We should look around for the machine that can install the arms. EXAMINE everything here to find it" to the main message queue spoken by Evie;
	mark advice "finding the arms installer" used.
	
Test workshop with "test volcano/w".


Chapter Arms installer

The arms installing machine is scenery in the workshop. It is distant.

Instead of using the arms installing machine:
	try entering the installation platform.


Section Installation platform

The installation platform is an enterable supporter in the workshop. The installation platform is scenery. The printed name of the installation platform is "platform".

Instead of entering the installation platform:
	now the arms are part of REAPR;
	display "I'm entering the platform and... oh, there's some strange whirring noise coming from above me!";
	narrate "A metallic voice coming from somewhere above says: 'Installation sequence initiated.'";
	display "The mechanical arms start moving and attach to the extra set of arms next to them. They bring them down and... hey! It's attaching them to the both sides of me! Now it's welding them to place. That kinda tickles...";
	narrate "You hear hisses of compressed air outside as the robot tries out its new attachments.";
	display "Whee!";
	if tutorial is on:
		assist "That should do it. You should be able to open the locked door now".
	
Instead of using the installation platform:
	try entering the installation platform.

Test arms with "test workshop/enter platform".


Chapter Tools

The various tools are plural-named scenery in the workshop. They are irrelevant. The description is "Tools of all sorts line the walls and lie on the floor. Someone ought to clean this place up."

Instead of taking the various tools:
	display "I couldn't possibly carry them all."


Chapter Machines

The strange machines are plural-named scenery in the workshop. The description is "Among the machines here is a machine with long mechanical arms[if arms are not part of REAPR] that seem to be holding another set of arms[end if]."

After examining the strange machines when the arms are not part of REAPR for the first time and the tutorial is on:
	assist "That's the arm installing machine. We should step on it to install the arms";
	continue the action.
	
Instead of using the strange machines when the arms are not part of REAPR and the tutorial is on:
	display "I'm not sure how or which machine to use.";
	assist "The only machine we're interested here is the arms installation machine";
	continue the action.


Chapter Assault tank

The assault tank is scenery in the workshop. It is irrelevant. The description is "The black assault tank is completely broken. It's flat like a pancake."

Understand "black" and "broken" and "flat" as the assault tank.

After examining the assault tank for the first time:
	narrate "'Ah, good old Doom Tank,' you sigh. 'Too bad the Human Sledgehammer pounded it to bits.'";
	
Instead of eating the assault tank:
	display "It just looks like a pancake. I don't think it's actually edible."
	
Instead of attacking the assault tank:
	display "It's pretty battered up already."
	
Instead of pushing or pulling or turning the assault tank:
	display "I think I'd better leave it where it is."



Part Corridor

After going to the corridor:
	say "A hollow voice says: 'This part is not implemented yet.'".


Volume Scenes

Book Intro

The introduction is a scene. The introduction begins when the Entire Game begins. The introduction ends when the location is not the hangar.

Test mobility with "look/z/z/z/z".

Part Initializing systems

Chapter System startup

Table of system startup
console message
"Starting gyroscopes..................DONE"
"Initializing pneumatic systems.......DONE"
"Loading personality module...........DONE"

First every turn when the examining tutorial is happening (this is the show system startup messages rule):
	if the table of system startup is non-empty:
		repeat through the table of system startup:
			if the currently speaking character is REAPR:
				say paragraph break;
			display console message entry;
			blank out the whole row;
			continue the action.


Chapter Looking

The looking tutorial is a scene. The looking tutorial begins when the introduction begins. The looking tutorial ends when we have looked for two times.

Every turn when the remainder after dividing the turn count by 3 is 0 and looking tutorial is happening and not looking:
	add "[Sir], please command LOOK so that I can initiate further startup procedures" to the main message queue with negligible priority spoken by Evie.

Looking is visualizing.
Examining something is visualizing.

[the first LOOK after the intro counts even though it's overridden, so this must be "for the second time"]
Before visualizing for the second time (this is the turning external cameras on rule):
	display "Turning external cameras on..........DONE
[line break]Starting image recognition engine....DONE[paragraph break]";

After looking for the second time:
	say paragraph break;
	display "Starting mobility engines............FAILED";
	assist "Bother. I have to start some other modules before we can get moving. Meanwhile, you can try to EXAMINE the items of interest. Just type EXAMINE followed by anything you want to take a look at, for example EXAMINE CONTROL CENTER";
	if the player's command matches "l":
		now the player might be expert is true.


Chapter Examining

The examining tutorial is a scene. The examining tutorial begins when the looking tutorial ends. The examining tutorial ends when REAPR is personified.

After examining something while the examining tutorial is happening for the first time:
	if the player's command includes "x":
		now the player might be expert is true;
	add "EXAMINE is a very useful command. It can give you more details of objects around you[if the player might be expert is false]. If you don't want to type the entire command, you can shorten it to X[end if]. Try examining a couple more things while the robot starts. You can review the room description and see what there is to examine by typing LOOK" to the main message queue with high priority spoken by Evie;
	continue the action;
	

Chapter Personality

The personality module initializes is a scene. The personality module initializes begins when the table of system startup is empty. The personality module initializes ends when REAPR is personified.

When the personality module initializes begins:
	narrate "The monitor flickers briefly.";
	display "Oh hi. Hello! Where am I? Who am I? What am I? Wait, I remember...[paragraph break]I am REAPR. That's such a nice name. Yes, I do like it.";
	narrate "'What happened? Did I break it?' you say.";
	assist "The system has just started its personality module. It is a temporary one, I assure you. We are still working on a personality more suitable for your sinister plans, [sir]";
	now REAPR is personified;
	mobility returns in 0 turns from now. [we'll use 0 because the counter won't advance anymore during this turn, so mobility will return immediately during the next turn.]
	

Chapter Mobility

At the time when mobility returns:
	now REAPR is mobile;
	start a new paragraph for REAPR;
	display "Starting mobility engines............DONE";
	assist "Sir, the robot's engines are now ready. You can move by using compass directions. The only exit from here is SOUTH".
	


Section Immobility rules

REAPR can be mobile or immobile. REAPR is immobile.

Before doing something when REAPR is immobile (this is the can't move when immobile rule):
	follow the immobility rules;
	if rule failed:
		if robotic:
			display "Mobility engines offline.";
		otherwise:
			display "Hey! I can't move! What gives?";
		assist "[one of]REAPR's engines have to fully start before we can move[if tutorial is on]. While we wait, try to EXAMINE things you see when you LOOK around[end if][or]Please be patient, [sir]. We'll be moving in no time[stopping]";
		stop the action.

Immobility rules are a rulebook.

Jumping is mobilizing.
Going is mobilizing.
Exiting is mobilizing.
Entering is mobilizing.

An immobility rule when the action requires a touchable noun:
	rule fails.
	
An immobility rule while mobilizing:
	rule fails.

An immobility rule:
	rule succeeds.
	

Book Arms

Part Armlessness

Definition: REAPR is armless rather than armed if the arms are not part of REAPR.

The arms are a thing.

Before doing something when REAPR is armless and REAPR is mobile (this is the can't handle things when armless rule):
	follow the armlessness rules;
	if rule failed:
		display "ERROR: Arms not found.";
		if the arms are unknown:
			if not robotic:
				display "[paragraph break]Uh oh. I feel so... incomplete.";
			narrate "'What?'";
			assist "Yes, well, I forgot to mention. We haven't fitted the robot with its arms yet";
			narrate "'Doesn't have arms[interrobang] What on earth am I even doing in an armless robot? Next you're telling me it shoots kittens and rainbows!'";
			assist "Of course not, [sir]. The robot doesn't have weapons installed yet";
			narrate "'...'";
			assist "The arms are ready for installation, though. Let's move on to the workshop[if the location is the heart of the volcano] to the WEST[otherwise]. It's first to the SOUTH from here, then to the WEST";
			now the arms are familiar;
		otherwise:
			assist "We need the robot's arms before we can do that. [if the location is the workshop]You should ENTER THE PLATFORM to install the arms[otherwise]Let's move on to the workshop[end if][if the location is the heart of the volcano] to the WEST[otherwise if the location is the hangar]. It's first to the SOUTH from here, then to the WEST[end if]";
		stop the action.


Armlessness rules are a rulebook.

An armlessness rule:
	rule succeeds.
	
An armlessness rule when entering or exiting:
	rule succeeds.
	
An armlessness rule when the action requires a touchable noun:
	rule fails.
	

Book Atmosphere

After going to the heart of the volcano for the first time:
	the remark about skeleton crew is triggered in 10 turns from now;
	continue the action.
	
At the time when the remark about skeleton crew is triggered:
	add the skeleton crew rule to the main message queue as low priority.

This is the skeleton crew rule:
	if the currently speaking character is not Evie and the location is not the engine room: [this tries to make sure the exchange doesn't show when other things are happening at the same time]
		narrate "'This place is suspiciously empty,' you remark. 'Where are all my minions?'";
		assist "It's Sunday. We're operating on a skeleton crew";
		narrate "'Skeletons, eh? Excellent.'";
		assist "[brief assistance ending]Figuratively, sir.";
		rule succeeds;
	rule fails.


Volume X - Testing 

Book Internal
	
To debug (X - indexed text):
	if debugging:
		say "[bracket]DEBUG: [X][close bracket]".


Book Development - Not for release

Chapter Debugging commands

Displaying debugging commands is an action out of world.
Understand "debug" as displaying debugging commands.

Carry out displaying debugging commands:
	say "You can use the following debugging commands:

 - GENDERS to switch main characters['] genders[line break]
- GONEAR to teleport to another room[line break]
- PURLOIN to put any game object in your inventory[line break]
- STYLE to switch between different ways of presenting character voices[line break]
- TEST to see which automated tests are available[line break]".

First when play begins:
	say "(Type DEBUG to list available debugging commands.)"


Chapter Gender

Switching genders is an action out of world.
Understand "gender" and "genders" as switching genders.

Carry out switching genders:
	if Malyon von Gloom is female:
		now Malyon von Gloom is male;
	otherwise:
		now Malyon von Gloom is female;
	if Evie is female:
		now Evie is male;
	otherwise:
		now Evie is female.
		
Report switching genders:
	say "Von Gloom is now [if Malyon von Gloom is female]female[otherwise]male[end if]. The assistant is now [if Evie is female]female and she[otherwise]male and he[end if] is called [Evie]."
